/**
* RefundTransactionResponseType.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter.
*/
package PayPalAPI.api.ebay;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URLDecoder;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.javacommerce.paypal.ws.NVPConstants;
import CoreComponentTypes.apis.ebay.BasicAmountType;
import eBLBaseComponents.apis.ebay.AckCodeType;
import eBLBaseComponents.apis.ebay.SeverityCodeType;
public class RefundTransactionResponseType extends eBLBaseComponents.apis.ebay.AbstractResponseType implements java.io.Serializable, NVPConstants {
/**
*
*/
private static final long serialVersionUID = 2974815005679210099L;
private static final Log LOG = LogFactory.getLog(RefundTransactionResponseType.class.getName());
/** Unique transaction ID of the refund.
*
*
* Character length and limitations:17 single-byte characters */
private java.lang.String refundTransactionID;
/** Amount subtracted from PayPal balance of original recipient of
* payment to make this refund */
private CoreComponentTypes.apis.ebay.BasicAmountType netRefundAmount;
/** Transaction fee refunded to original recipient of payment */
private CoreComponentTypes.apis.ebay.BasicAmountType feeRefundAmount;
/** Amount of money refunded to original payer */
private CoreComponentTypes.apis.ebay.BasicAmountType grossRefundAmount;
public RefundTransactionResponseType() {
}
public RefundTransactionResponseType(
java.lang.String refundTransactionID,
CoreComponentTypes.apis.ebay.BasicAmountType netRefundAmount,
CoreComponentTypes.apis.ebay.BasicAmountType feeRefundAmount,
CoreComponentTypes.apis.ebay.BasicAmountType grossRefundAmount) {
this.refundTransactionID = refundTransactionID;
this.netRefundAmount = netRefundAmount;
this.feeRefundAmount = feeRefundAmount;
this.grossRefundAmount = grossRefundAmount;
}
public RefundTransactionResponseType(InputStream _is) {
BufferedReader reader = new BufferedReader(new InputStreamReader(_is));
String currentLine = null;
try {
while ((currentLine = reader.readLine()) != null) {
String[] pairs = StringUtils.split(currentLine, "&");
if (LOG.isDebugEnabled()) {
LOG.debug("Read line [" + currentLine + "], split into " + pairs.length + " pairs.");
}
for (int i = 0; i < pairs.length; i++) {
String[] nvp = StringUtils.split(pairs[i], "=");
String name = nvp[0];
String value = null;
if (nvp.length == 2) {
value = URLDecoder.decode(nvp[1], "UTF-8");
}
if (LOG.isDebugEnabled()) {
LOG.debug("Read pair [" + name + "]/[" + value + "]");
}
if (isCommonField(name)) {
processCommonField(name, value);
}
else if (name.equals(FIELD_REFUNDTRANSACTIONID)) {
setRefundTransactionID(value);
}
else if (name.equals(FIELD_NETREFUNDAMT)) {
setNetRefundAmount(new BasicAmountType(value));
}
else if (name.equals(FIELD_FEEREFUNDAMT)) {
setFeeRefundAmount(new BasicAmountType(value));
}
else if (name.equals(FIELD_GROSSREFUNDAMT)) {
setGrossRefundAmount(new BasicAmountType(value));
}
}
}
} catch (Exception e) {
if (LOG.isErrorEnabled()) {
LOG.error("Exception caught processing response: " + e.getLocalizedMessage(), e);
}
setAck(AckCodeType.Failure);
addSeverityCode("L_SEVERITYCODE0", SeverityCodeType.Error.toString());
addErrorCode("L_ERRORCODE0", "JC1000");
addLongMessage("L_LONGMESSAGE0", "Error processing GetTransactionDetails API call");
addShortMessage("L_SHORTMESSAGE0", "Error processing request");
}
}
/**
* Gets the refundTransactionID value for this RefundTransactionResponseType.
*
* @return refundTransactionID Unique transaction ID of the refund.
*
*
* Character length and limitations:17 single-byte characters
*/
public java.lang.String getRefundTransactionID() {
return refundTransactionID;
}
/**
* Sets the refundTransactionID value for this RefundTransactionResponseType.
*
* @param refundTransactionID Unique transaction ID of the refund.
*
*
* Character length and limitations:17 single-byte characters
*/
public void setRefundTransactionID(java.lang.String refundTransactionID) {
this.refundTransactionID = refundTransactionID;
}
/**
* Gets the netRefundAmount value for this RefundTransactionResponseType.
*
* @return netRefundAmount Amount subtracted from PayPal balance of original recipient of
* payment to make this refund
*/
public CoreComponentTypes.apis.ebay.BasicAmountType getNetRefundAmount() {
return netRefundAmount;
}
/**
* Sets the netRefundAmount value for this RefundTransactionResponseType.
*
* @param netRefundAmount Amount subtracted from PayPal balance of original recipient of
* payment to make this refund
*/
public void setNetRefundAmount(CoreComponentTypes.apis.ebay.BasicAmountType netRefundAmount) {
this.netRefundAmount = netRefundAmount;
}
/**
* Gets the feeRefundAmount value for this RefundTransactionResponseType.
*
* @return feeRefundAmount Transaction fee refunded to original recipient of payment
*/
public CoreComponentTypes.apis.ebay.BasicAmountType getFeeRefundAmount() {
return feeRefundAmount;
}
/**
* Sets the feeRefundAmount value for this RefundTransactionResponseType.
*
* @param feeRefundAmount Transaction fee refunded to original recipient of payment
*/
public void setFeeRefundAmount(CoreComponentTypes.apis.ebay.BasicAmountType feeRefundAmount) {
this.feeRefundAmount = feeRefundAmount;
}
/**
* Gets the grossRefundAmount value for this RefundTransactionResponseType.
*
* @return grossRefundAmount Amount of money refunded to original payer
*/
public CoreComponentTypes.apis.ebay.BasicAmountType getGrossRefundAmount() {
return grossRefundAmount;
}
/**
* Sets the grossRefundAmount value for this RefundTransactionResponseType.
*
* @param grossRefundAmount Amount of money refunded to original payer
*/
public void setGrossRefundAmount(CoreComponentTypes.apis.ebay.BasicAmountType grossRefundAmount) {
this.grossRefundAmount = grossRefundAmount;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof RefundTransactionResponseType)) return false;
RefundTransactionResponseType other = (RefundTransactionResponseType) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = super.equals(obj) &&
((this.refundTransactionID==null && other.getRefundTransactionID()==null) ||
(this.refundTransactionID!=null &&
this.refundTransactionID.equals(other.getRefundTransactionID()))) &&
((this.netRefundAmount==null && other.getNetRefundAmount()==null) ||
(this.netRefundAmount!=null &&
this.netRefundAmount.equals(other.getNetRefundAmount()))) &&
((this.feeRefundAmount==null && other.getFeeRefundAmount()==null) ||
(this.feeRefundAmount!=null &&
this.feeRefundAmount.equals(other.getFeeRefundAmount()))) &&
((this.grossRefundAmount==null && other.getGrossRefundAmount()==null) ||
(this.grossRefundAmount!=null &&
this.grossRefundAmount.equals(other.getGrossRefundAmount())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = super.hashCode();
if (getRefundTransactionID() != null) {
_hashCode += getRefundTransactionID().hashCode();
}
if (getNetRefundAmount() != null) {
_hashCode += getNetRefundAmount().hashCode();
}
if (getFeeRefundAmount() != null) {
_hashCode += getFeeRefundAmount().hashCode();
}
if (getGrossRefundAmount() != null) {
_hashCode += getGrossRefundAmount().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
}